package com.wxzz.elearing.course.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wxzz.elearing.course.vo.CurriculumFileVo;
import com.wxzz.elearning.common.bean.BaseEntity;
import com.wxzz.elearning.common.bean.BigDecimalSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.influxdb.annotation.Column;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 课程
 * </p>
 *
 * @author
 * @since 2021-03-10
 */
@Data
@ApiModel(value = "Curriculum对象", description = "课程")
public class Curriculum extends BaseEntity {

    @ApiModelProperty(value = "企业id")
    private Long enterpriseId;

    @ApiModelProperty(value = "讲师id(必填)", required = true)
    private Long docentId;

    @ApiModelProperty(value = "平台课程二级分类id")
    private Long platformCurriculumCategoryId;

    @ApiModelProperty(value = "企业课程二级分类id")
    private Long enterpriseCurriculumCategoryId;

    @ApiModelProperty(value = "平台课程一级分类id")
    private Long platformCurriculumCategoryFirstId;

    @ApiModelProperty(value = "企业课程一级分类id")
    private Long enterpriseCurriculumCategoryFirstId;

    @Excel(name = "课程标题", orderNum = "0", width = 15)
    @ApiModelProperty(value = "课程标题")
    private String curriculumTitle;

    @Excel(name = "课程描述", orderNum = "1", width = 30)
    @ApiModelProperty(value = "课程描述")
    private String curriculumDescribe;

    @ApiModelProperty(value = "课程介绍")
    private String curriculumDetail;

    @ApiModelProperty(value = "课件 多个文件url用,分隔")
    private String curriculumFile;

    @ApiModelProperty(value = "课件名称 多个用,分隔 与课件url对应")
    private String curriculumFileName;

    @ApiModelProperty(value = "文件大小 多个用,分隔")
    private String curriculumFileSize;

    @ApiModelProperty(value = "0-平台课程 1-内部课程 2-讲师培训课程 3-培训课程")
    private Integer curriculumType;

    @Excel(name = "课程现价(用户)", orderNum = "2", width = 15)
    @JsonSerialize(using = BigDecimalSerialize.class)
    @ApiModelProperty(value = "课程现价(用户)")
    private BigDecimal curriculumPrice;

    @JsonSerialize(using = BigDecimalSerialize.class)
    @ApiModelProperty(value = "课程原价(用户)")
    private BigDecimal curriculumOldPrice;

    @ApiModelProperty(value = "课程banner图")
    private String curriculumBanner;

    @Excel(name = "课程现价(企业)", orderNum = "3", width = 15)
    @JsonSerialize(using = BigDecimalSerialize.class)
    @ApiModelProperty(value = "课程现价(企业)")
    private BigDecimal curriculumPriceEnterprise;

    @JsonSerialize(using = BigDecimalSerialize.class)
    @ApiModelProperty(value = "课程原价(企业)")
    private BigDecimal curriculumOldPriceEnterprise;

    @Excel(name = "课程状态", orderNum = "4", width = 15,replace = {"未上架_0", "未审核(待审核)_1", "已通过(已上架)_2", "未通过_3"})
    @ApiModelProperty(value = "课程状态 0-未上架 1-未审核(待审核) 2-已通过(已上架) 3-未通过")
    private Integer status;

    @ApiModelProperty(value = "是否封禁 0-否 1-是")
    private Integer isBan;

    @ApiModelProperty(value = "是否为企业申请的平台课程 0-否 1-是")
    private Integer isApply;

    @ApiModelProperty(value = "是否为企业购买的平台课程 0-否 1-是")
    private Integer isEnterpriseBuy;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "原课程id")
    private Long oldCurriculumId;

    @ApiModelProperty(value = "订单id(默认0)")
    private Long userOrderId;

    @ApiModelProperty(value = "发布者id")
    private Long adminUserId;

    @ApiModelProperty(value = "是否讲师自己发布 0-否 1-是")
    private Integer isDocentSend;

//    @TableField(exist = false)
//    @ApiModelProperty(value = "星级")
//    private Long startLevel = 0L;

    @TableField(exist = false)
    @ApiModelProperty(value = "视频进度")
    private Long seeTime = 0L;

    @TableField(exist = false)
    @ApiModelProperty(value = "0-正在学 1-已学完")
    private Integer seeStatus = 0;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否收藏 0-否 1-是")
    private Integer isCollect = 0;

    @TableField(exist = false)
    @ApiModelProperty(value = "课件")
    private List<CurriculumFileVo> curriculumFileVos;

    @TableField(exist = false)
    @JsonSerialize(using = BigDecimalSerialize.class)
    @ApiModelProperty(value = "学习进度 xx.xx%")
    private BigDecimal studySchedule;

    @TableField(exist = false)
    @ApiModelProperty(value = "学习人数")
    private Integer curriculumStudyNum = 0;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否购买 0-未购买 1-已购买 ")
    private Integer isBuy = 0;

    @TableField(exist = false)
    @ApiModelProperty(value = "讲师对象")
    private String docent;

    @Excel(name = "讲师名字", orderNum = "5", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "讲师名字")
    private String docentName;

    @Excel(name = "企业名称", orderNum = "6", width = 20)
    @TableField(exist = false)
    @ApiModelProperty(value = "企业名称")
    private String enterpriseName;

    @TableField(exist = false)
    @ApiModelProperty(value = "课程时长")
    private double curriculumTime = 0L;

    @Excel(name = "章节数量", orderNum = "7", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "章节数量")
    private Integer curriculumSectionNum = 0;

    @TableField(exist = false)
    @ApiModelProperty(value = "封禁/下架理由")
    private String forbiddenReason;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否公众号提醒 0-否 1-是")
    private Integer isPublic;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否短信提醒 0-否 1-是")
    private Integer isMms;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否已评星 0-否 1-是")
    private Integer isStar;

    @TableField(exist = false)
    @ApiModelProperty(value = "评论数量")
    private Long commentCount;
}
